package main.java.com.lee.pattern.forkjoin;

import java.util.concurrent.CountedCompleter;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ForkJoinPool;
import java.util.concurrent.ForkJoinTask;

/**
 * @Description TODO
 * @Author winston
 * @DateTime 2022/2/19
 */
public class ForkJoinTest {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        ForkJoinPool forkJoinPool = new ForkJoinPool();
        AddTask addTask = new AddTask(0, 10000);
        ForkJoinTask<Integer> submit = forkJoinPool.submit(addTask);
        Integer integer = submit.get();
        System.out.println(integer);

    }

    public static void testCountedCompleter() {
//        CountedCompleter
    }
}
